const path = require('path');
const WMerge = require('webpack-merge');
const baseConfig = require('./webpack.base.conf.js');
const webpack = require('webpack');

module.exports = WMerge.merge(baseConfig, {
  output: {
    publicPath: '/',
    libraryTarget:"umd",
  },
  devServer: {
    historyApiFallback: true,
    contentBase: path.join(__dirname, '../zj'),
    hot: true,
    inline: true,
    progress: true,
    host: '0.0.0.0',
    disableHostCheck: true,
    proxy: {
      '/gateway': {
        target: 'http://152.136.121.161:8080',//'http://192.168.1.215', // 192.168.1.212  // 192.168.1.201
        changeOrigin: true,
        secure: false,
        pathRewrite: {
          '^/gateway': '/jpress',
        },
      }
    },
  },
  plugins: [
    new webpack.DefinePlugin({
      PRODUCTION: JSON.stringify(false),
      DEVELOPMENT: JSON.stringify(true),
      TESTING: JSON.stringify(false),
    }),
  ],
  devtool: 'cheap-module-eval-source-map',
});
